Systems that employ a virtual machine (VM) typically execute platform-independent program code by way of an interpreter that directly executes such code. To improve execution performance, many VMs also support just-in-time (JIT) compilation of all or portions of platform-independent program code to native machine code at run-time using a JIT-compiler. These VMs thus support dual modes of execution for any particular segment of platform-independent program code. That is, the VMs can either execute the program code by interpreting it or by compiling it using a JIT-compiler and then executing the compiled code natively. An execution thread for a process may alternate between modes by interpreting some segments of the program code and running JIT-compiled (or “JITted”) machine code for other segments.